<?php
if (function_exists('xdebug_disable')) {
    // otherwise disables Soap Exception throwing
    xdebug_disable();
}

ini_set('default_socket_timeout', 2);
ini_set('soap.wsdl_cache_enabled', '0');
$curPath = pathinfo(__FILE__, PATHINFO_DIRNAME);
define('SITE_PATH', substr($curPath, 0, strrpos($curPath, '/')));
require_once(SITE_PATH . '/class/error_codes.php');

function __autoload($className) {
    $path = '';
    if (strpos($className, '_') !== false) {
        $path = str_replace('_', '/', substr($className, 0, strrpos($className, '_'))) . '/';
    }
    $classPath = SITE_PATH . '/class/' . $path . $className . '.php';
    if (file_exists($classPath)) {
        require_once($classPath);
    }
}

define('SOAP_CONNECTION_TIMEOUT', 2);
define('PORTAL_URL', 'http://esi.vels.dev.modera.net/project/portal');
define('SERVICE_NO_ID', 'T2NO2');
define('SERVICE_ALLOWED_AREAS', '12,13');
define('SERVICE_ALLOWED_ESS', 'T2ES1,T2ES2');
define('SERVICE_ALLOWED_RKS', 'T2RK1,T2RK2');
define('PORTAL_CRON_HASH', 'asd89gq43plt');

define('CLIENT_CLASS_ES1', 'Client_ES1_ElectricitySupplier');
define('CLIENT_CLASS_ES2', 'Client_ES2_ElectricitySupplierServiceImplService');
define('CLIENT_CLASS_RK1', 'Client_RK1_RuritaniaKradoService');
define('CLIENT_CLASS_RK2', 'Client_RK2_T2RK2');
